#ifndef __6D9D4B85_3947_4080_B39D_B215EEEBFCF0__
#define __6D9D4B85_3947_4080_B39D_B215EEEBFCF0__

#include "../import/head.h"
#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos
{
    class aio_impl;
    class msg_impl;
    class aio_key;

    class aio_helper
    {
    public:
        aio_helper( aio_impl * pAioImpl );
        ~aio_helper();

    protected:
        int tcp_proc( aio_key * lpKey, int nFlags );
        int udp_proc( aio_key * lpKey, int nFlags );

        int helper_proc( msg_impl * lpMsg );
        int user_tcp( msg_impl * lpMsg );
        int user_udp( msg_impl * lpMsg );

    protected:
        aio_impl * m_pAioImpl;

    public:
        // 
        // epoll event.
        // 
        int epoll_proc( aio_key * lpKey, int nFlags );

        // 
        // process user request. 
        // 
        int user_request();

        // 
        // 0 : not quit; not 0, quit
        // 
        int timeout();

    };
} // xos

#endif // __6D9D4B85_3947_4080_B39D_B215EEEBFCF0__
